!***********************************************************************
!                                                                      *
      INTEGER FUNCTION IDIGIT (CST)
!                                                                      *
!                                                                      *
!                                                                      *
!***********************************************************************
!-----------------------------------------------
      IMPLICIT NONE
!-----------------------------------------------
!   D u m m y   A r g u m e n t s
!-----------------------------------------------
      CHARACTER , INTENT(IN) :: CST
!-----------------------------------------------
!   L o c a l   V a r i a b l e s
!-----------------------------------------------
      INTEGER :: I
      CHARACTER, DIMENSION(0:9) :: CDGT
!-----------------------------------------------
!
      DATA CDGT/ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'/
!
      DO I = 0, 9
         IF (CST /= CDGT(I)) CYCLE
         IDIGIT = I
         EXIT
      END DO
!
      RETURN
      END FUNCTION IDIGIT
